package me.lijf.mqlite.redis.message;

import lombok.extern.log4j.Log4j2;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

@Component
@Log4j2
public class MessageConsumer2 implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        String channel=new String(message.getChannel());
        String body=new String(message.getBody());
        log.info("consumer2消费了[{}]的消息：{}",channel,body);
    }
}
